import http from '@/utils/http/axios';


//获取菜单列表
export function fetchMenuList() {
    return http.request({
        url: '/system/menu/fetchMenuList',
        method: 'get',
    })
}

//添加菜单
export function addMenu(params) {
    return http.request({
        url: '/system/menu/addMenu',
        method: 'post',
        params
    })
}

//删除菜单
export function deleteMenu(params) {
    return http.request({
        url: `/system/menu/deleteMenu/${params}`,
        method: 'delete',
    })
}

//删除菜单权限
export function deleteMenuAuth(params) {
    return http.request({
        url: `/system/menu/deleteMenuAuth/${params}`,
        method: 'delete',
    })
}

//更新菜单
export function updateMenu(params) {
    return http.request({
        url: `/system/menu/updateMenu`,
        method: 'put',
        params
    })
}

//获取菜单权限列表
export function fetchMenuAuth(params) {
    return http.request({
        url: `/system/menu/fetchMenuAuth/${params}`,
        method: 'get',
    })
}

//菜单绑定权限
export function addMenuAuth(params){
    return http.request({
        url:`/system/menu/addMenuAuth`,
        method:'post',
        params
    })
}